CREATE TABLE [agency].[PortalCurrency]
(
[PortalCurrencyId] [int] NOT NULL IDENTITY(1, 1),
[CurrencyId] [int] NOT NULL,
[PortalId] [int] NOT NULL,
[ISOCode] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Code] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Symbol] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DisplayIndex] [int] NOT NULL,
[BaseCurrency] [bit] NOT NULL CONSTRAINT [DF_PortalCurrency_BaseCurrency] DEFAULT ((0)),
[Active] [bit] NOT NULL,
[Deleted] [bit] NOT NULL,
[CreatedBy] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [int] NULL,
[ModifiedOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [agency].[PortalCurrency] ADD CONSTRAINT [PK_PortalCurrency] PRIMARY KEY CLUSTERED  ([PortalCurrencyId]) ON [PRIMARY]
GO
ALTER TABLE [agency].[PortalCurrency] ADD CONSTRAINT [FK_PortalCurrency_Currency] FOREIGN KEY ([CurrencyId]) REFERENCES [agency].[Currency] ([CurrencyId])
GO
ALTER TABLE [agency].[PortalCurrency] ADD CONSTRAINT [FK_PortalCurrency_Portal] FOREIGN KEY ([PortalId]) REFERENCES [agency].[Portal] ([PortalId])
GO
